/***********************************************************************  
 *   @package：cn.wj.base.util，@class-name：ThreadLocalContext.java   
 *   @copyright     Copyright:   2015-2016     
 *   @creator       wenjie 
 *   @create-time   2016年3月5日   下午4:13:21   
 *   @revision      $Id: 1.0    
 ***********************************************************************/
package cn.wj.base.util;

import java.sql.Connection;

public class ThreadLocalContext {
	private ThreadLocal<Connection> threadLocal = new ThreadLocal<Connection>();
	private static ThreadLocalContext instance = new ThreadLocalContext();

	private ThreadLocalContext() {
	}

	public static ThreadLocalContext getInstance() {
		return instance;
	}

	public void bind(Connection value) {
		threadLocal.set(value);
	}

	public Connection get() {
		return threadLocal.get();
	}

	public void remove() {
		threadLocal.remove();
	}
}
